package com.xhs.main.service.cwb.impl;

import com.xhs.main.dao.cwb.CwbGrossreceiptsDao;
import com.xhs.main.entity.cwb.CwbGrossreceipts;
import com.xhs.main.service.cwb.CwbGrossreceiptsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CwbGrossreceiptsServiceImpl implements CwbGrossreceiptsService {

    @Autowired
    CwbGrossreceiptsDao cwbGrossreceiptsDao;


    @Override
    public void addGrossreceipts() {
        cwbGrossreceiptsDao.insertGrossreceipts(new CwbGrossreceipts(3,200.00,"销售部"));
    }

    @Override
    public List<CwbGrossreceipts> getAllGrossreceipts() {
        List<CwbGrossreceipts> grossreceipts =  cwbGrossreceiptsDao.selectAllcwbGrossreceipts();
        return grossreceipts;
    }

    @Override
    public Double getTotalMoney() {
        Double money = cwbGrossreceiptsDao.selectTotalMoney();
        return money;
    }
}
